package com.alibaba.citrus.cr.b2b.trade.order.functions.utils;

import com.epoch.app.crb2btradecenter.dto.request.SendOutGoodsRequest;
import com.epoch.app.crb2btradecenter.enums.OrderStatus;
import com.epoch.app.crb2btradecenter.sdo.DeliveryOrderDetailSDO;
import org.springframework.util.StringUtils;

public class ModifyDeliveryOrderDetailConverter {

    public static DeliveryOrderDetailSDO converter(SendOutGoodsRequest request) {
        DeliveryOrderDetailSDO deliveryOrderDetailSDO = new DeliveryOrderDetailSDO();
        if (!StringUtils.isEmpty(request.getDeliveryOrderId())) {
            deliveryOrderDetailSDO.setDeliveryOrderId(request.getDeliveryOrderId());
        }
        deliveryOrderDetailSDO.setDeliveryStatus(OrderStatus.SHIPPED.getCode());
        return deliveryOrderDetailSDO;
    }
}